package com.qf.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 添加员工
 * @author 千锋健哥
 */
@WebServlet("/insert")
public class InserEmpController extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1. 接收员工添加数据

        //2. 调用service添加员工方法

        //3. 跳转到列表页面, 查询所有员工, 刷新员工列表数据
        resp.sendRedirect("/empList");
    }

}
